package com.breadenglish.cms.api.app.gateway.model;

import com.breadenglish.cms.api.app.gateway.util.CustomDateSerializer;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import org.jsondoc.core.annotation.ApiObject;
import org.jsondoc.core.annotation.ApiObjectField;

import java.util.Date;

/**
 * Created by jk on 16/1/4.
 */
@ApiObject
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
public class BeVipSchedule {
    @ApiObjectField(description = "ID")
    private int id;

    @ApiObjectField(description = "日期,上课日期")
    @JsonSerialize(using = CustomDateSerializer.class)
    private Date dt;

    @ApiObjectField(description = "状态,1:未上,2:已上,3:缺勤,4:补课")
    private int state;

    @ApiObjectField(description = "BE VIP 列表数据")
    private BeVip beVip;

    public static BeVipSchedule build(int id, Date dt, int state) {
        BeVipSchedule beVipSchedule = new BeVipSchedule();
        beVipSchedule.id = id;
        beVipSchedule.dt = dt;
        beVipSchedule.state = state;
        return beVipSchedule;
    }

    public static BeVipSchedule buildWithBeVip(int id, Date dt, int state, BeVip beVip) {
        BeVipSchedule beVipSchedule = new BeVipSchedule();
        beVipSchedule.id = id;
        beVipSchedule.dt = dt;
        beVipSchedule.state = state;
        beVipSchedule.beVip = beVip;
        return beVipSchedule;
    }
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public Date getDt() {
        return dt;
    }

    public void setDt(Date dt) {
        this.dt = dt;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public BeVip getBeVip() {
        return beVip;
    }

    public void setBeVip(BeVip beVip) {
        this.beVip = beVip;
    }
}
